/**
 * @author xinjie.txt
 * @time: 2020年7月9日 下午6:44:03
 */
package com.jiepu.exercise.primary.chapter5.exercise5;

/**
 * @Description:
 * @author xinjie.txt
 */
public class CheckingAccount extends Account {

	private double overdraft;

	/**
	 * @return the overdraft
	 */
	public double getOverdraft() {
		return overdraft;
	}

	/**
	 * @param overdraft
	 *            the overdraft to set
	 */
	public void setOverdraft(double overdraft) {
		this.overdraft = overdraft;
	}

	public CheckingAccount() {
		super();
		// TODO Auto-generated constructor stub
	}

	public CheckingAccount(double balance) {
		this(balance, 0.0);
	}

	public CheckingAccount(double balance, double overdraft) {
		super(balance);
		this.overdraft = overdraft;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.jiepu.exercise.primary.chapter5.exercise1234.Account#withdraw(double)
	 */
	@Override
	public boolean withdraw(double amount) {
		// TODO Auto-generated method stub
		if (amount <= banlance + overdraft) {
			return true;
		} else {
			return false;
		}
	}
	
}
